package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 题目信息对象 sys_question
 *
 * @author ruoyi
 * @date 2025-09-17
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@FieldDefaults(level = AccessLevel.PRIVATE)
@TableName(value = "sys_question", autoResultMap = true)
public class SysQuestion extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Excel(name = "题目ID")
    Long id;

    @Excel(name = "题目类型", dictType = "question_type")
    @NotBlank(message = "题目类型不能为空")
    String questionType;

    @Excel(name = "题目属性", dictType = "question_classification")
    @NotBlank(message = "题目属性不能为空")
    String questionClassification;

    @Excel(name = "题目题干")
    @NotBlank(message = "题目题干不能为空")
    String questionTitle;

    @Excel(name = "选项")
    @TableField(value = "option_json", typeHandler = JacksonTypeHandler.class)
    List<QuestionItemObject> optionJson;

    // 选择项
    @TableField(value = "option_json",exist = false, typeHandler = JacksonTypeHandler.class)
    List<QuestionItemObject> selectionJson;

    @TableLogic
    String delFlag;

}
